3.106 \(\int \frac{\cos ^4(c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=134 \[ \frac{i a^2}{24 d (a+i a \tan (c+d x))^3}-\frac{i a}{32 d (a-i a \tan (c+d x))^2}+\frac{3 i a}{32 d (a+i a \tan (c+d x))^2}-\frac{i}{8 d (a-i a \tan (c+d x))}+\frac{3 i}{16 d (a+i a \tan (c+d x))}+\frac{5 x}{16 a} \]

[Out]

(5*x)/(16*a) - ((I/32)*a)/(d*(a - I*a*Tan[c + d*x])^2) - (I/8)/(d*(a - I*a*Tan[c + d*x])) + ((I/24)*a^2)/(d*(a
 + I*a*Tan[c + d*x])^3) + (((3*I)/32)*a)/(d*(a + I*a*Tan[c + d*x])^2) + ((3*I)/16)/(d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0872302, antiderivative size = 134, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ \frac{i a^2}{24 d (a+i a \tan (c+d x))^3}-\frac{i a}{32 d (a-i a \tan (c+d x))^2}+\frac{3 i a}{32 d (a+i a \tan (c+d x))^2}-\frac{i}{8 d (a-i a \tan (c+d x))}+\frac{3 i}{16 d (a+i a \tan (c+d x))}+\frac{5 x}{16 a} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

(5*x)/(16*a) - ((I/32)*a)/(d*(a - I*a*Tan[c + d*x])^2) - (I/8)/(d*(a - I*a*Tan[c + d*x])) + ((I/24)*a^2)/(d*(a
 + I*a*Tan[c + d*x])^3) + (((3*I)/32)*a)/(d*(a + I*a*Tan[c + d*x])^2) + ((3*I)/16)/(d*(a + I*a*Tan[c + d*x]))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cos ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \frac{1}{(a-x)^3 (a+x)^4} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \left (\frac{1}{16 a^4 (a-x)^3}+\frac{1}{8 a^5 (a-x)^2}+\frac{1}{8 a^3 (a+x)^4}+\frac{3}{16 a^4 (a+x)^3}+\frac{3}{16 a^5 (a+x)^2}+\frac{5}{16 a^5 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{i a}{32 d (a-i a \tan (c+d x))^2}-\frac{i}{8 d (a-i a \tan (c+d x))}+\frac{i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac{3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac{3 i}{16 d (a+i a \tan (c+d x))}-\frac{(5 i) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{16 d}\\ &=\frac{5 x}{16 a}-\frac{i a}{32 d (a-i a \tan (c+d x))^2}-\frac{i}{8 d (a-i a \tan (c+d x))}+\frac{i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac{3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac{3 i}{16 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.20648, size = 109, normalized size = 0.81 \[ -\frac{\sec (c+d x) (-120 d x \sin (c+d x)+60 i \sin (c+d x)+45 i \sin (3 (c+d x))+5 i \sin (5 (c+d x))+60 i (2 d x+i) \cos (c+d x)+15 \cos (3 (c+d x))+\cos (5 (c+d x)))}{384 a d (\tan (c+d x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

-(Sec[c + d*x]*((60*I)*(I + 2*d*x)*Cos[c + d*x] + 15*Cos[3*(c + d*x)] + Cos[5*(c + d*x)] + (60*I)*Sin[c + d*x]
 - 120*d*x*Sin[c + d*x] + (45*I)*Sin[3*(c + d*x)] + (5*I)*Sin[5*(c + d*x)]))/(384*a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.083, size = 137, normalized size = 1. \begin{align*}{\frac{-{\frac{5\,i}{32}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{ad}}-{\frac{{\frac{3\,i}{32}}}{ad \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{1}{24\,ad \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{3}{16\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{32}}}{ad \left ( \tan \left ( dx+c \right ) +i \right ) ^{2}}}+{\frac{{\frac{5\,i}{32}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}}+{\frac{1}{8\,ad \left ( \tan \left ( dx+c \right ) +i \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x)

[Out]

-5/32*I/a/d*ln(tan(d*x+c)-I)-3/32*I/a/d/(tan(d*x+c)-I)^2-1/24/a/d/(tan(d*x+c)-I)^3+3/16/a/d/(tan(d*x+c)-I)+1/3
2*I/a/d/(tan(d*x+c)+I)^2+5/32*I/a/d*ln(tan(d*x+c)+I)+1/8/a/d/(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.94405, size = 242, normalized size = 1.81 \begin{align*} \frac{{\left (120 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 60 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 15 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{384 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/384*(120*d*x*e^(6*I*d*x + 6*I*c) - 3*I*e^(10*I*d*x + 10*I*c) - 30*I*e^(8*I*d*x + 8*I*c) + 60*I*e^(4*I*d*x +
4*I*c) + 15*I*e^(2*I*d*x + 2*I*c) + 2*I)*e^(-6*I*d*x - 6*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.790826, size = 221, normalized size = 1.65 \begin{align*} \begin{cases} \frac{\left (- 50331648 i a^{4} d^{4} e^{16 i c} e^{4 i d x} - 503316480 i a^{4} d^{4} e^{14 i c} e^{2 i d x} + 1006632960 i a^{4} d^{4} e^{10 i c} e^{- 2 i d x} + 251658240 i a^{4} d^{4} e^{8 i c} e^{- 4 i d x} + 33554432 i a^{4} d^{4} e^{6 i c} e^{- 6 i d x}\right ) e^{- 12 i c}}{6442450944 a^{5} d^{5}} & \text{for}\: 6442450944 a^{5} d^{5} e^{12 i c} \neq 0 \\x \left (\frac{\left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 6 i c}}{32 a} - \frac{5}{16 a}\right ) & \text{otherwise} \end{cases} + \frac{5 x}{16 a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise(((-50331648*I*a**4*d**4*exp(16*I*c)*exp(4*I*d*x) - 503316480*I*a**4*d**4*exp(14*I*c)*exp(2*I*d*x) +
1006632960*I*a**4*d**4*exp(10*I*c)*exp(-2*I*d*x) + 251658240*I*a**4*d**4*exp(8*I*c)*exp(-4*I*d*x) + 33554432*I
*a**4*d**4*exp(6*I*c)*exp(-6*I*d*x))*exp(-12*I*c)/(6442450944*a**5*d**5), Ne(6442450944*a**5*d**5*exp(12*I*c),
 0)), (x*((exp(10*I*c) + 5*exp(8*I*c) + 10*exp(6*I*c) + 10*exp(4*I*c) + 5*exp(2*I*c) + 1)*exp(-6*I*c)/(32*a) -
 5/(16*a)), True)) + 5*x/(16*a)

________________________________________________________________________________________

Giac [A]  time = 1.16066, size = 157, normalized size = 1.17 \begin{align*} -\frac{-\frac{30 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac{30 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac{3 \,{\left (-15 i \, \tan \left (d x + c\right )^{2} + 38 \, \tan \left (d x + c\right ) + 25 i\right )}}{a{\left (-i \, \tan \left (d x + c\right ) + 1\right )}^{2}} - \frac{55 i \, \tan \left (d x + c\right )^{3} + 201 \, \tan \left (d x + c\right )^{2} - 255 i \, \tan \left (d x + c\right ) - 117}{a{\left (\tan \left (d x + c\right ) - i\right )}^{3}}}{192 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/192*(-30*I*log(tan(d*x + c) + I)/a + 30*I*log(tan(d*x + c) - I)/a + 3*(-15*I*tan(d*x + c)^2 + 38*tan(d*x +
c) + 25*I)/(a*(-I*tan(d*x + c) + 1)^2) - (55*I*tan(d*x + c)^3 + 201*tan(d*x + c)^2 - 255*I*tan(d*x + c) - 117)
/(a*(tan(d*x + c) - I)^3))/d